import request from '@/utils/request'

// 查询项目列表
export function listOrder(query) {
  return request({
    url: '/order/information/list',
    method: 'get',
    params: query
  })
}

// 查询订单仪器列表
export function listOrderEqu(query) {
  return request({
    url: '/order/equ/list',
    method: 'get',
    params: query
  })
}

// 查询订单信息反馈记录历史列表
export function giveBackList(query) {
  return request({
    url: '/order/histroy/list',
    method: 'get',
    params: query
  })
}

// 加载对应部门人员树形结构
export function userDeptTree(id) {
  return request({
    url: '/oa/out/userDeptTree',
    method: 'get'
  })
}

// 获取项目详细信息
export function getOrder(id) {
  return request({
    url: '/order/information/' + id,
    method: 'get'
  })
}

// 获取详细信息
export function getOrderDetail(id) {
  return request({
    url: '/order/details/' + id,
    method: 'get'
  })
}

// 新增项目
export function addOrder(data) {
  return request({
    url: '/order/information',
    method: 'post',
    data: data
  })
}

// 新增订单详情
export function addOrderDetail(data) {
  return request({
    url: '/order/details',
    method: 'post',
    data: data
  })
}

// 新增订单反馈
export function addOrderHistroy(data) {
  return request({
    url: '/order/histroy',
    method: 'post',
    data: data
  })
}

// 修改项目
export function updateOrder(data) {
  return request({
    url: '/order/information',
    method: 'put',
    data: data
  })
}

// 修改项目
export function updateOrderDetail(data) {
  return request({
    url: '/order/details',
    method: 'put',
    data: data
  })
}

// 删除项目
export function deleteOrder(ids) {
  return request({
    url: '/order/information/' + ids,
    method: 'delete'
  })
}
